﻿#region USING
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.IO;
using System.Text;
#endregion

public class Task
{
    public Poisk poisk { get; set; }
    public string home { get; set; }
    public short page = 0; //по умалчиванию на первой странице
    public string slovo;
    public Task(Poisk _poisk, string _home, string _slovo)
    {
        this.poisk = _poisk;
        this.home = _home;
        this.slovo = _slovo;
    }
   
    Random R = new Random();
    public Uri url
    {
        get
        {
            Uri rez = new Uri("about:blank");
            switch (poisk.name)
            {
                case "Yandex": 
                    rez = new Uri("http://yandex.ru/yandsearch?text=" + slovo + "&numdoc=50&p=" + page+"&lr=213");
                    break;
                case "Google":
                    rez = new Uri("http://www.google.ru/search?complete=1&hl=ru&lr=&newwindow=1&safe=active&as_qdr=all&q=" + slovo + "&num=" + 100 + "&start=" + page * 100 + "&sa=N");
                    break;
            }
            return rez;
        }
    }
  
    public override string ToString()
    {
        return this.poisk.name + "_" + this.home + "_" + this.slovo;
    }

    public string TagStr()
    {
        return this.slovo;
    }
}
